package main

import (
	"context"
	"fmt"
	"github.com/go-redis/redis/v8"
)

var ctx = context.Background()

//Del() 删除缓存项
func main() {
	rdb := redis.NewClient(&redis.Options{
		Addr:     "81.68.186.20:6379",
		Password: "ffdd2021@",
		DB:       0,
	})
	defer rdb.Close()
	i, err := rdb.Del(ctx, "name").Result()
	if err != nil {
		panic(err)
	}
	fmt.Println("成功删除了", i, "个")

}
